<%@page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="keywords" content="qn_budget">
	<meta name="description" content="qn_budget">
	<title>报价单</title>
		<%@ include file="../../common/common.jsp"%>
		

<style type="text/css">
#fm {
	margin: 0;
	padding: 10px 30px;
}

.ftitle {
	font-size: 14px;
	font-weight: bold;
	color: #666;
	padding: 5px 0;
	margin-bottom: 10px;
	border-bottom: 1px solid #ccc;
}

.fitem {
	margin-bottom: 5px;
}

.fitem label {
	display: inline-block;
	width: 70px;
}

</style>
		
	<script type="text/javascript">

		$(function(){
			$('#dg').datagrid({
				view: detailview,
				detailFormatter:function(index,row){
					return '<div style="padding:2px"><table id="ddv-' + index + '"></table></div>';
				},
				onExpandRow: function(index,row){
					$('#ddv-'+index).datagrid({
						url:'datagrid22_getdetail.php?itemid='+row.itemid,
						fitColumns:true,
						singleSelect:true,
						height:'auto',
						columns:[[
							{field:'orderid',title:'Order ID',width:100},
							{field:'quantity',title:'Quantity',width:100},
							{field:'unitprice',title:'Unit Price',width:100}
						]],
						onResize:function(){
							$('#dg').datagrid('fixDetailRowHeight',index);
						},
						onLoadSuccess:function(){
							setTimeout(function(){
								$('#dg').datagrid('fixDetailRowHeight',index);
							},0);
						}
					});
					$('#dg').datagrid('fixDetailRowHeight',index);
				}
			});
		});
		
var url;
function newPro_info() {
	$('#dlg').dialog('open').dialog('setTitle', '新增项目');
	$('#fm').form('clear');
	url = 'save_Ct_info.php';
}

<!--加载合同信息-->
$(function(){
			$('#cc').combogrid({
				panelWidth:450,
				value:'006',

				idField:'code',
				textField:'name',
				url:'datagrid_data.json',
				columns:[[
					{field:'code',title:'Code',width:60},
					{field:'name',title:'Name',width:100},
					{field:'addr',title:'Address',width:120},
					{field:'col4',title:'Col41',width:100}
				]]
			});
		});
		
<!--加载工程信息-->	
$(function(){
			$('#pro_work').edatagrid({
				url: 'get_users.php',
				saveUrl: 'save_user.php',
				updateUrl: 'update_user.php',
				destroyUrl: 'destroy_user.php'
			});
		});
		
	</script>
</head>
<body>

	<div id="toolbar">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok" plain="true"
				onclick="newPro_info()">报表</a>
			
	</div>
	
	<table id="dg" style="width:1000px;height:380px"
			url="datagrid22_getdata.php" 
			title="项目信息"
			singleSelect="true" fitColumns="true" pagination = "true" toolbar="#toolbar">
		<thead>
			<tr>
				<th field="itemid" width="10">序号</th>
				<th field="productid" width="40" align="center" >合同名称</th>
				<th field="listprice" align="center" width="40">项目名称</th>
				<th field="unitcost" align="center" width="20">施工单位</th>
				<th field="attr1" width="20" >管道长度</th>
				<th field="1" width="20" align="center">物管信息</th>
				<th field="2" width="20" align="center">总户数</th>
				<th field="3" width="20" align="center">总面积</th>
				<th field="4" width="20" align="center">化粪池数量</th>
				<th field="5" width="20" align="center">项目预算</th>
				<th field="6" width="20" align="center">创建时间</th>
				<th field="7" width="40" align="center">项目说明</th>
			</tr>
		</thead>
	</table>
	
	<div id="dlg" class="easyui-dialog"
			style="width: 800px; height: 450px; padding: 10px 20px" closed="true"
			buttons="#dlg-buttons">
			
			
	<div id="tt" class="easyui-tabs" tools="#tab-tools" style="width:750px;height:350px;">
		<div title="项目信息" tools="#p-tools" style="padding:20px;">
		
			<form id="fm" method="post" novalidate>
			<!-- 合同区域 -->
			<div>
				<table style="border:1px solid #ccc;width: 600px">
					<tr>
						<td>
							<div class="fitem">
								<label>
									合同名称:
								</label>
								<select id="cc" name="dept" style="width:250px;"></select>
							</div>
						</td>
						

					</tr>
				</table>
			</div>
			<!-- 项目信息展示区域 -->
			<div>
				<table  style="border:1px solid #ccc" >

					<tr>
						<td>
							<div class="fitem">
								<label>
									项目名称:
								</label>
								<input name="3" width="5px">
							</div>
						</td>
						<td>
							<div class="fitem">
								<label>
									施工单位:
								</label>
								<input name="4" class="easyui-validatebox" validType="email" width="10px">
							</div>
						</td>
						
						<td>
							<div class="fitem">
								<label>
									管道长度:
								</label>
								<input name="5" class="easyui-validatebox" validType="number">
							</div>
						</td>
						
						<td>

							<div class="fitem">
								<label>
									物管信息:
								</label>
								<input name="6" class="easyui-validatebox" validType="number">
							</div>

						</td>
					</tr>
					<tr>
						<td>
							<div class="fitem">
								<label>
									总户数:
								</label>
								<input name="a">
							</div>
						</td>
						<td>
							<div class="fitem">
								<label>
									总面积:
								</label>
								<input name="b" class="easyui-validatebox" validType="email">
							</div>
						</td>
						
						<td>
							<div class="fitem">
								<label>
									化粪池数量:
								</label>
								<input name="c" class="easyui-validatebox" validType="number">
							</div>
						</td>
						
						<td>

							<div class="fitem">
								<label>
									项目预算:
								</label>
								<input name="d" class="easyui-validatebox" validType="number">
							</div>

						</td>
						
					</tr>
					
					<tr>
						<td colspan="4">

							<div class="fitem">
								<label>
									合同说明:
								</label>
								<textarea rows="" cols=""></textarea>
							</div>
						</td>
					</tr>

				</table>
			
			</div>	
			
			</form>
			
		
		
		</div>


	<div title="工程信息" closable="false" style="overflow:hidden">
			
	<table id="pro_work" title="工程信息" style="width:680px;height:350px"
			toolbar="#pro_work_toolbar" pagination="true"
			rownumbers="true" fitColumns="true" singleSelect="true">
		<thead>
			<tr>
				<th field="firstname" width="50" editor="{type:'validatebox',options:{required:true}}">化粪池编号</th>
				<th field="lastname" width="50" editor="{type:'validatebox',options:{required:true}}">施工分队</th>
				<th field="email" width="30" editor="{type:'combobox',options:{validType:'email'}}">化粪池类型</th>				
				<th field="1" width="20" editor="{type:'validatebox',options:{validType:'email'}}">工程内容</th>
				<th field="2" width="20" editor="{type:'datebox',options:{validType:'email'}}">开工时间</th>
				<th field="3" width="50" editor="{type:'validatebox',options:{validType:'email'}}">工程说明</th>
				
			</tr>
		</thead>
	</table>
	<div id="pro_work_toolbar">
		<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#pro_work').edatagrid('addRow')">新增</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#pro_work').edatagrid('destroyRow')">删除</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#pro_work').edatagrid('saveRow')">保存</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#pro_work').edatagrid('cancelRow')">取消</a>
	</div>
	
		</div>
		
		
		
	</div>
    
    <div id="tab-tools">
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-cut" onclick="javascript:alert('cut')"></a>
		<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-save" onclick="javascript:alert('save')"></a>
	</div>			
			
			
			
			
		<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok"
				onclick="savePro_info()">Save</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel"
				onclick="javascript:$('#dlg').dialog('close')">Cancel</a>
		</div>
				
			
			
			
			
				
			
			
		</div>
		
	
</body>
</html>